/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PmMainmaterial extends BasicModel<PmMainmaterial> {
  createtime?: string; // 创建时间
  name?: string; // 项目名称
  pcode?: string; // 项目编码
  sno?: string; // sno
  fdno?: string; // fdno
  mcode?: string; // 材料编码
  mname?: string; // 材料名称
  mstd?: string; // 规格型号
  num?: number; // 数量
  unit?: string; // 单位
  istart?: number; // istart
}

export const pmMainmaterialList = (params?: PmMainmaterial | any) =>
  defHttp.get<PmMainmaterial>({ url: adminPath + '/material/main/pmMainmaterial/list', params });

export const pmMainmaterialListData = (params?: PmMainmaterial | any) =>
  defHttp.post<Page<PmMainmaterial>>({ url: adminPath + '/material/main/pmMainmaterial/listData', params });

export const pmMainmaterialForm = (params?: PmMainmaterial | any) =>
  defHttp.get<PmMainmaterial>({ url: adminPath + '/material/main/pmMainmaterial/form', params });

export const pmMainmaterialSave = (params?: any, data?: PmMainmaterial | any) =>
  defHttp.postJson<PmMainmaterial>({ url: adminPath + '/material/main/pmMainmaterial/save', params, data });

export const pmMainmaterialDelete = (params?: PmMainmaterial | any) =>
  defHttp.get<PmMainmaterial>({ url: adminPath + '/material/main/pmMainmaterial/delete', params });
